package com.jcrj.remoteclient.ui;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import net.tsz.afinal.annotation.view.ViewInject;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.jcrj.remoteclient.util.UIHelper;

public class LoginActivity extends BaseActivity {

	@ViewInject(id = R.id.sure, click = "sureClick")
	Button btn;
	@ViewInject(id = R.id.SimCard)
	EditText simCard;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login);
	}

	public void sureClick(View v) {
		if (simCard.getText().toString().isEmpty()) {
			UIHelper.ToastMessage(this, "SIM卡号不能为空");
		} else if (!simCard.getText().toString().isEmpty()
				&& !simCard.getText().toString().matches("[0-9+]*")) {
			UIHelper.ToastMessage(this, "SIM卡号是输入只能是数字和+");
		} else {
			Map<String, Serializable> map = new HashMap<String, Serializable>();
			map.put("sim_card", simCard.getText().toString());
			UIHelper.openActivityNoPre(LoginActivity.this, MainActivity.class,
					map);
		}

	}

}
